#ifndef CATMULL_SUBDIVIDER_H

//--------------------------------------------------------
//		DEFINITIONS
//--------------------------------------------------------
#define CATMULL_SUBDIVIDER_H

//--------------------------------------------------------
//		INCLUDES
//--------------------------------------------------------
#include "Subdivider.h"

//--------------------------------------------------------
//		CLASS: CatmullSubdivider
//--------------------------------------------------------
class CatmullSubdivider : public Subdivider
{
public: // Public Interface

	CatmullSubdivider(){}
	~CatmullSubdivider(){}

	void subdivide			 ( ModelFrame* frame );		// completes one iteration of subdivision 
	void showConnectivity	 ( const Selection* s );	// sets the "important mesh" for a selected point or face
	void showWeights		 ( const Selection* s );	// sets the weights from coarse mesh points for a given connectivity point 


private: // Helper Functions

	void  createMeshes		  ( );						// loads connected/subdivided internal meshes 
	void  computeEdgeMidpoints( EHandle& );				// adds edge points to connectivity/subdivided meshes 
	int	  addFaces			  ( FIter&, FHIter& );		// adds four new faces in connectivity and subdivided mesh 
	void  calculateV_V		  ( VHandle& );				// calculates/sets vertex_vertex subdivided point 
	void  calcConnectivity	  ( const Selection* );
	void  loadImportance	  ( ModelFrame* frame, FHandle fh, PolyMesh* im );
	void  loadImportance	  ( ModelFrame* frame, VHandle& vh, PolyMesh* im );
	void  checkImportance	  ( ModelFrame* frame );
	void  doSharpVertex		  ( ModelFrame* f, VHandle& vh );
	void  doSharpEdgeSetting  ( ModelFrame* f, EHandle& eh );
	Point doSubdivisionMask	  ( PolyMesh*m, PolyMesh*s, VHandle& vh );
	void  calcWeights		  ( const Selection* s );
};

#endif